package com.bltec.emergency.service.lawsService.impl;

import com.bltec.emergency.mapper.LawsMapper;
import com.bltec.emergency.model.Laws;
import com.bltec.emergency.service.lawsService.LawsService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service
public class LawsServiceImpl implements LawsService {
    @Resource
    private LawsMapper lawsMapper;
    @Override
    public boolean add(Laws laws) {
        return lawsMapper.insert(laws);
    }

    @Override
    public boolean deleteLawsById(Long id) {
        return lawsMapper.setDisableById(id);
    }

    @Override
    public boolean updateLawsById(Laws laws) {
        return lawsMapper.updateLawsById(laws);
    }

    @Override
    public Laws getLawsById(Long id) {
        return lawsMapper.getLawsById(id);
    }

    @Override
    public List<Laws> getAll() {
        return lawsMapper.selectAll();
    }
}
